package org.infodavid.common.model;

import java.util.Map;

import org.infodavid.common.persistence.IBasicDataObject;


/**
 * The Interface IPermissions.
 */
public interface IPermissions extends IBasicDataObject {

  /** The FEATURE. */
  String FEATURE = "feature";

  /** The ALLOWED. */
  Boolean ALLOWED = Boolean.TRUE;

  /** The DENIED. */
  Boolean DENIED = Boolean.FALSE;

  /**
   * Checks if is defined.
   * @param feature the feature
   * @return true, if is defined
   */
  boolean isDefined(String feature);

  /**
   * Checks if is allowed.
   * @param feature the feature
   * @return true, if is allowed
   */
  boolean isAllowed(String feature);

  /**
   * Checks if is denied.
   * @param feature the feature
   * @return true, if is denied
   */
  boolean isDenied(String feature);

  /**
   * Gets the values.
   * @return the values
   */
  Map<String,Boolean> getValues();

  /**
   * Sets the values.
   * @param values the values
   */
  void setValues(Map<String,Boolean> values);

  /**
   * Gets the value.
   * @param feature the feature
   * @return the value
   */
  Boolean getValue(String feature);

  /**
   * Sets the value.
   * @param feature the feature
   * @param value the value
   */
  void setValue(String feature, Boolean value);

  /**
   * Sets the undefined.
   * @param feature the new undefined
   */
  void setUndefined(String feature);

  /**
   * Clears all the permissions. All are set to undefined.
   */
  void clear();
}
